* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #fafbfc;
  color: #333;
  font-size: 14px;
  min-width: 320px;
  margin: 0;
  padding: 0;
}

.container {
  width: 320px;
  min-height: 200px;
  max-height: 600px;
  background: #ffffff;
  border: 1px solid #e8eaed;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04),
              0 1px 2px rgba(0, 0, 0, 0.06);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 固定顶部区域 */
.fixed-header {
  flex-shrink: 0;
  background: #ffffff;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 顶部标题栏样式 */
.contact-header {
  background: linear-gradient(135deg, #f5f6f7 0%, #e8eaed 100%);
  color: #2d3748;
  padding: 12px 16px;
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  border-bottom: 1px solid #dfe1e5;
  position: relative;
}

/* 可滚动内容区域 */
.scrollable-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
}

/* 隐藏滚动条但保留滚动功能 */
.scrollable-content::-webkit-scrollbar {
  display: none;
}

/* 兼容 Firefox */
.scrollable-content {
  scrollbar-width: none;
}

/* 兼容 IE/Edge */
.scrollable-content {
  -ms-overflow-style: none;
}

.header-title {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.3px;
  color: #1a202c;
}

.header-version {
  font-size: 12px;
  color: #718096;
  font-weight: 400;
  letter-spacing: 0.2px;
}

/* 分隔线 */
.divider {
  height: 1px;
  background: #e8eaed;
  margin: 0 0 16px 0;
}

/* 页面状态检测样式 */
.page-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
  border-radius: 8px;
  border: 1px solid #bbdefb;
  margin: 0 0 16px 0;
  min-height: 44px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.status-label {
  font-size: 13px;
  font-weight: 500;
  color: #5f6368;
  letter-spacing: 0.2px;
  flex-shrink: 0;
  line-height: 20px;
}

.status-value {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}

.status-icon {
  font-size: 16px;
  line-height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  order: 2;
}

/* 自定义勾形图标 */
.check-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  position: relative;
  background: #10b981;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.check-icon::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* 自定义叉形图标 */
.cross-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  position: relative;
  background: currentColor;
}

.cross-icon::before,
.cross-icon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 2px;
  background: white;
  border-radius: 1px;
}

.cross-icon::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.cross-icon::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* 其他页面状态的图标更小 */
.status-value.unknown .status-icon {
  font-size: 14px;
}

.status-text {
  letter-spacing: 0.2px;
  line-height: 20px;
  white-space: nowrap;
  order: 1;
}

/* 不同状态的颜色 */
.status-value.cursor_bind {
  color: #1a73e8;
}

.status-value.cursor_other {
  color: #4285f4;
}

.status-value.augment_bind {
  color: #7c3aed;
}

.status-value.augment_other {
  color: #a78bfa;
}

.status-value.unknown {
  color: #dc2626;
}

.status-value.detecting {
  color: #5f6368;
}

/* BIN选择器样式 */
.bin-selector {
  margin-bottom: 16px;
}

.bin-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bin-column {
  flex: 1;
}

.bin-column label {
  display: block;
  margin-bottom: 8px;
  color: #5f6368;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* 算法提示样式 */
.algorithm-notice {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notice-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.notice-text {
  font-size: 12px;
  color: #d97706;
  font-weight: 500;
  line-height: 1.4;
}

.select-box {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #dfe1e5;
  border-radius: 6px;
  font-size: 14px;
  color: #1a1a1a;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.select-box:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

.select-box:hover {
  border-color: #c5c7cb;
}

/* 自定义下拉选择框样式 */
select.select-box {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f6368' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

select.select-box:hover {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
}

/* 下拉列表滚动条样式 */
select.select-box::-webkit-scrollbar {
  width: 8px;
}

select.select-box::-webkit-scrollbar-track {
  background: #f1f3f5;
  border-radius: 4px;
}

select.select-box::-webkit-scrollbar-thumb {
  background: #c5c7cb;
  border-radius: 4px;
  transition: all 0.2s ease;
}

select.select-box::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Firefox 下拉列表滚动条样式 */
select.select-box {
  scrollbar-width: thin;
  scrollbar-color: #c5c7cb #e8eaed;
}

/* 按钮样式 */
.btn {
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}

.btn:last-of-type {
  margin-bottom: 0;
}

.btn-primary {
  background: #1a73e8;
  color: white;
}

.btn-primary:hover {
  background: #1557b0;
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.btn-primary:active {
  background: #1348a0;
}

.btn-secondary {
  background: #10b981;
  color: white;
}

.btn-secondary:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-secondary:active {
  transform: translateY(0);
  background: #047857;
}

.btn-accent {
  background: #ef4444;
  color: white;
}

.btn-accent:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-accent:active {
  transform: translateY(0);
  background: #b91c1c;
}

.icon {
  display: none;
}

/* Session Token 样式 */
.session-token-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
  border-radius: 8px;
  margin-bottom: 16px;
  border: 2px solid #d2e3fc;
  gap: 10px;
}

.session-token-label {
  font-size: 13px;
  color: #1a73e8;
  font-weight: 600;
  letter-spacing: 0.2px;
  flex-shrink: 0;
}

.session-token-value {
  flex: 1;
  padding: 8px 12px;
  background: white;
  border: 1px solid #d2e3fc;
  border-radius: 6px;
  font-size: 12px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  color: #1a73e8;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
}

.session-token-value:hover {
  background: #f8fbff;
  border-color: #1a73e8;
  box-shadow: 0 2px 6px rgba(26, 115, 232, 0.15);
}

.session-token-value:active {
  transform: scale(0.98);
}

.session-token-value .token-text {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-token-value.not-detected {
  color: #9aa0a6;
  font-style: italic;
  cursor: default;
}

.session-token-value.not-detected:hover {
  background: white;
  border-color: #d2e3fc;
  box-shadow: none;
}

.session-token-value.copied::after {
  content: '✓ 已复制';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #1a73e8;
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  animation: fadeInOut 1.5s ease;
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
}

.session-endpoint {
  margin: 20px 0;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.session-endpoint label {
  font-size: 13px;
  color: #4a5568;
  font-weight: 500;
}

.session-endpoint input {
  padding: 10px 12px;
  border: 1px solid #cbd5f5;
  border-radius: 6px;
  font-size: 13px;
  color: #1a202c;
  outline: none;
}

.session-endpoint input:focus {
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.session-endpoint-hint {
  font-size: 12px;
  color: #718096;
  margin: 0;
  line-height: 1.5;
}

.action-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.action-buttons .btn {
  flex: 1;
  height: 48px;
  border-radius: 14px;
  margin-bottom: 0;
}

.tmpmail-section {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

.tmpmail-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 10px;
}

.tmpmail-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.tmpmail-field label {
  font-size: 13px;
  color: #4a5568;
}

.tmpmail-field input {
  border: 1px solid #cbd5f5;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
}

.tmpmail-field input:focus {
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.tmpmail-hint {
  font-size: 12px;
  color: #718096;
  margin: 0 0 12px;
}

.tmpmail-result {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tmpmail-result-email {
  font-size: 13px;
  color: #1a202c;
}

.tmpmail-result-email .label {
  color: #4a5568;
  margin-right: 6px;
}

.tmpmail-link {
  font-size: 13px;
  color: #1a73e8;
  text-decoration: none;
}

.tmpmail-link:hover {
  text-decoration: underline;
}

/* 联系方式样式 */
.contact-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e8eaed;
}

.contact-label {
  font-size: 13px;
  color: #5f6368;
  font-weight: 500;
}

.contact-value {
  font-size: 13px;
  color: #1a73e8;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 4px;
}

.contact-value:hover {
  background: rgba(26, 115, 232, 0.08);
  color: #1557b0;
}

.contact-value:active {
  transform: translateY(0);
}

/* 数量选择器样式 */
.quantity-selector {
  margin: 15px 0;
}

.quantity-selector label {
  display: block;
  margin-bottom: 8px;
  color: #4a5568;
  font-size: 13px;
  font-weight: 500;
}

/* 卡号输出区域样式 */
.card-output {
  margin-top: 10px;
  position: relative;
}

.btn-clear {
  position: absolute;
  top: 10px;
  right: 20px;
  z-index: 10;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #dfe1e5;
  border-radius: 4px;
  font-size: 14px;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.2s ease;
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-clear.show {
  display: flex;
}

.btn-clear:hover {
  background: #f1f3f5;
  border-color: #c5c7cb;
  color: #6b7280;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.btn-clear:active {
  transform: scale(0.95);
}

.output-header {
  display: none;
}

.output-textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px 14px;
  border: 1px solid #dfe1e5;
  border-radius: 6px;
  font-size: 12px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  color: #1a1a1a;
  background: #f8f9fa;
  resize: vertical;
  transition: all 0.2s ease;
  outline: none;
}

.output-textarea:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
  background: white;
}

.output-textarea::placeholder {
  color: #a0aec0;
  font-style: italic;
}

/* 自定义滚动条样式 */
.output-textarea::-webkit-scrollbar {
  width: 6px;
}

.output-textarea::-webkit-scrollbar-track {
  background: #f1f3f5;
  border-radius: 3px;
}

.output-textarea::-webkit-scrollbar-thumb {
  background: #c5c7cb;
  border-radius: 3px;
  transition: all 0.2s ease;
}

.output-textarea::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Firefox 滚动条样式 */
.output-textarea {
  scrollbar-width: thin;
  scrollbar-color: #c5c7cb #f0f4f8;
}

/* 消息提示样式 */
.message {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: 6px;
  z-index: 10000;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(10px);
}

.message-success {
  background: rgba(16, 185, 129, 0.95);
  color: white;
}

.message-error {
  background: rgba(239, 68, 68, 0.95);
  color: white;
}

.message-warning {
  background: rgba(245, 158, 11, 0.95);
  color: white;
}

.message-info {
  background: rgba(26, 115, 232, 0.95);
  color: white;
}
